<template>
    <form @submit.prevent="Submit">
        <slot :model="model" :rules="rules"></slot>
    </form>
</template>

<script setup>
import { provide, reactive } from 'vue';

const props=defineProps({
    model: Object,
    rules: Object,
    width: String
})
const CheckArr = reactive([])
provide("rules",props.rules)
provide("model",props.model)
provide("CheckArr",CheckArr)
provide("width",props.width)
const emits = defineEmits(["ksubmit"])
function Submit(e) {
    let allChecked = true
    CheckArr.forEach(v=>{
        allChecked=v()&&allChecked 
    })
    emits("ksubmit",allChecked)
}
</script>